<?php 
if($_GET['id']){
	$id=$_GET['id'];
	$str=file_get_contents('music.json');
	$arr=json_decode($str,true);
	foreach($arr as $key=>$item){
		if($id==$item['id']){
			array_splice($arr,$key,1);
			break;
		}
	}
	file_put_contents('music.json',json_encode($arr));
	header('Location:list.php');
}
 ?>